:root {
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary: #4f46e5;
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-family); -webkit-font-smoothing: antialiased; }

body {
    min-height: 100vh;
    background-color: #f8fafc;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 1s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--text-main);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
input, textarea, select, button {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.header {
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 100;
}

.logo-box { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 32px; height: 32px; border-radius: 6px; }
.logo-text {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.8px;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header-btns { display: flex; gap: 10px; }
.btn-header {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.btn-header:hover { background: rgba(255, 255, 255, 0.85); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.container {
    flex: 1;
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding-top: 50px;
}

.stats-bar {
    display: flex;
    gap: 24px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}
.stats-bar:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
}
.stats-bar .stat-mini i { color: #bbb; }
.stat-mini { display: flex; align-items: center; gap: 8px; color: var(--text-main); font-size: 13px; font-weight: 500; }
.stat-mini span.val { color: var(--text-main); font-weight: 700; }

.card-main {
    padding: 40px 48px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 360px;
}

.liquid_glass-wrapper {
  position: relative;
  display: flex;
  overflow: hidden;
  background: transparent;
  border-radius: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.liquid_glass-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(30px) saturate(180%);
  border-radius: 32px;
}

.liquid_glass-outer {
  backdrop-filter: url(#liquid_glass_filter);
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 32px;

  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect x="0" y="0" width="100%" height="100%" rx="0" ry="0" fill="white"/></svg>'),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect x="5" y="5" width="calc(100% - 10px)" height="calc(100% - 10px)" rx="21" ry="21" fill="white"/></svg>');
  mask-composite: exclude;
}

.liquid_glass-cover {
  backdrop-filter: blur(1px);
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 32px;
  background: rgba(0, 0, 0, 0.03);
}

.liquid_glass-sharp {
  position: absolute;
  inset: 0;
  z-index: 3;

  box-shadow: inset 1px 1px 0px 0px rgba(255, 255, 255, 0.5), inset -1px -1px 0px 0px rgba(255, 255, 255, 0.6);
  border-radius: 32px;
}

.liquid_glass-reflect {
  position: absolute;
  inset: 1px;
  z-index: 2;

  box-shadow: inset 2px 2px 6px 2px rgba(255, 255, 255, 0.2), inset -2px -2px 4px -1px rgba(255, 255, 255, 0.2);
  border-radius: 32px;
}

.focus-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-sub);
}
.status-ing { background: rgba(79, 70, 229, 0.08); color: var(--primary); border: 1px solid rgba(79, 70, 229, 0.1); }
.status-pause { background: rgba(217, 119, 6, 0.08); color: var(--warning); border: 1px solid rgba(217, 119, 6, 0.1); }

.focus-time {
    font-size: 88px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    margin: 20px 0;
    color: var(--text-main);
    display: flex;
    gap: 4px;
}
.time-unit { display: inline-block; min-width: 1.2ch; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

.focus-level-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--text-sub);
    font-size: 16px;
    font-weight: 500;
}
.focus-level-value { color: var(--primary); font-weight: 800; font-size: 22px; opacity: 0.9; }

.btn-group { display: flex; gap: 14px; margin-top: 20px; }
.btn {
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; }
.spin { animation: btn-spin 1s linear infinite; display: inline-block; }
@keyframes btn-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3); }
.btn-outline { background: rgba(255, 255, 255, 0.5); border: 1px solid var(--glass-border); color: var(--text-main); }
.btn-outline:hover:not(:disabled) { background: #fff; transform: translateY(-2px); }

.yiyan-float {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 14px 28px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 50;
    max-width: 80%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}
.yiyan-float:hover { background: rgba(0, 0, 0, 0.5); transform: translateX(-50%) translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }

.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}
.modal-content {
    background: rgba(255, 255, 255, 0.92);
    width: 90%; max-width: 480px;
    padding: 32px; border-radius: 24px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.closing .modal-content {
    animation: modalClose 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes modalPop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes modalClose { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }

.modal-close {
    position: absolute; top: 20px; right: 20px;
    background: #f1f5f9; border: none; color: var(--text-sub);
    width: 32px; height: 32px; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: #e2e8f0; color: var(--text-main); }

.setting-form div { margin-bottom: 24px; }
.setting-form label { display: block; color: var(--text-sub); font-size: 13px; margin-bottom: 8px; font-weight: 600; }
.setting-form input, .setting-form textarea, .setting-form select {
    width: 100%; background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 14px 16px;
    color: var(--text-main); font-size: 15px; outline: none;
    transition: all 0.3s;
    appearance: none;
}
.setting-form textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 300px;
}
.setting-form input:focus, .setting-form textarea:focus, .setting-form select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08); }

.setting-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 48px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}
.setting-form select:hover {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}
.setting-form select option {
    background: #fff;
    padding: 14px 16px;
    font-weight: 500;
    color: var(--text-main);
    border-radius: 0;
    border: none;
}
.setting-form select option:hover {
    background: #f1f5f9;
}
.setting-form select option:checked {
    background: var(--primary);
    color: #fff;
}

#pauseModal .modal-content {
    padding: 32px;
}

#pauseModal h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 28px;
    letter-spacing: -0.3px;
}

.pause-reason-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.pause-reason-item {
    height: 52px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pause-reason-item span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.pause-reason-item .check-icon {
    width: 20px;
    height: 20px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    position: relative;
    z-index: 1;
}

.pause-reason-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pause-reason-item.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.pause-reason-item.active span {
    color: #fff;
    font-weight: 600;
}

.pause-reason-item.active .check-icon {
    opacity: 1;
    transform: scale(1);
}

.pause-reason-item:active {
    transform: translateY(0);
}

#pauseModal .btn-primary {
    height: 52px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

#pauseModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

#pauseModal .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.records-list { max-height: 400px; overflow-y: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px; color: var(--text-sub); font-weight: 600; border-bottom: 1px solid #f1f5f9; }
td { padding: 12px; border-bottom: 1px solid #f8fafc; }

.btn-detail {
    padding: 5px 10px; background: #f1f5f9;
    border-radius: 8px; cursor: pointer; color: var(--text-main);
    border: 1px solid #e2e8f0; font-size: 12px;
    transition: var(--transition);
}
.btn-detail:hover { background: #e2e8f0; }

.score-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    min-width: 36px;
}
.score-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.score-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.score-yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.score-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.score-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.score-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.score-gradient {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(168, 85, 247, 0.15));
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.code-box {
    background: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 16px; margin: 16px 0;
    font-family: 'Inter', sans-serif; color: var(--text-main);
    font-size: 18px; font-weight: 700; text-align: center;
    cursor: pointer; transition: var(--transition);
}
.code-box:hover { background: #e2e8f0; transform: translateY(-1px); }

.auth-container {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px) saturate(180%);
    width: 100%; max-width: 400px; padding: 40px; border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.note-item {
    padding: 12px 20px; border-radius: 12px; background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 600; color: var(--text-main);
    transform: translateY(-20px); opacity: 0; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.note-item.note-show { transform: translateY(0); opacity: 1; }
.note-item.note-hide { transform: translateY(-20px); opacity: 0; }
.note-success i { color: var(--success); }
.note-error i { color: var(--error); }
.note-info i { color: var(--primary); }
