:root {
    --background-secondary: #f4f5f7;
    --card: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --destructive: #dc2626;
    --icon-muted: #6b7280;
    --text: #1f2329;
    --text-muted: #6b7280;
    --success: #16a34a;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.12);
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background-secondary);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.page {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 16px 64px;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin: 0 0 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin: 0 0 24px;
    text-align: center;
}

.page-header .page-title {
    margin: 0;
}

.refresh-time {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    flex-basis: 100%;
    text-align: center;
}

.machine-card .machine-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.machines-row {
    display: flex;
    gap: 12px;
}

.machines-row .machine-card {
    flex: 1;
    min-width: 0;
}

.machine-status {
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: 600;
}

.filter-bar {
    margin-bottom: 20px;
}

.filter-bar .btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.filter-bar .btn.active:hover {
    background: var(--primary-hover);
}

.card {
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0 0 16px;
    text-align: center;
}

.inner-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 12px 16px;
    transition: box-shadow 150ms, transform 150ms;
}

.inner-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status-label {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.status-value {
    font-size: var(--font-size-base);
    font-weight: 600;
}

.text-success { color: var(--success); }
.text-danger { color: var(--destructive); }
.text-muted { color: var(--text-muted); font-size: var(--font-size-sm); }

.mt-3 { margin-top: 16px; }

/* 按钮 */
.btn {
    display: flex;
    height: 32px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    outline: none;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    transition: all 150ms;
}

.btn:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--card);
    color: var(--destructive);
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--destructive) 10%, transparent);
}

.btn-block {
    width: 100%;
}

/* 分组容器 */
.btn-group-card {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.btn-group-card .btn {
    box-shadow: none;
    background: transparent;
}

.btn-group-card .btn:hover {
    box-shadow: var(--shadow-sm);
    background: var(--background-secondary);
}

/* 表单 */
.form-input {
    width: 100%;
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--background-secondary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text);
    outline: none;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 150ms;
}

.form-input:focus {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 8px;
}

.msg {
    margin-top: 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
}
