* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f7;
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* 开屏画面 */
#splash-screen {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 15vh;
}

.splash-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/bg.jpg');
    background-size: cover;
    background-position: bottom center;
    background-repeat: no-repeat;
    z-index: -1;
    /* 手机端图片1080x1920竖屏，底部对齐；电脑端底部对齐 */
}

/* 大屏时图片居中显示在下方 */
@media (min-width: 768px) {
    .splash-bg {
        background-size: contain;
        background-position: bottom center;
    }
}

.splash-content {
    z-index: 1;
}

.splash-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.splash-btn {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 500;
    border: none;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.splash-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.splash-btn.primary {
    background-color: rgba(59, 130, 246, 0.8);
}

.splash-btn.primary:hover {
    background-color: rgba(59, 130, 246, 1);
}

/* 功能页 */
#main-screen {
    background-color: #f5f5f7;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    padding: 20px;
}

/* 配置区域 */
.config-section {
    flex: 1;
    padding-top: 20px;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.config-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #e8e8ed;
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background-color: #d1d1d6;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn svg .slash {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.icon-btn.muted svg .slash {
    opacity: 1;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-row label {
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    min-width: 80px;
    flex-shrink: 0;
}

.form-row .input-group {
    flex: 1;
    max-width: 200px;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.input-group input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    background: transparent;
    text-align: right;
}

.input-group .unit {
    font-size: 14px;
    color: #86868b;
    margin-left: 8px;
}

.exercise-selector {
    flex: 1;
    max-width: 200px;
    position: relative;
}

.exercise-selector select {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
    background-color: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

#custom-name {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
    background-color: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-top: 8px;
    outline: none;
}

#custom-name.hidden {
    display: none;
}

/* 控制区域 */
.control-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 30px;
    padding-bottom: 40px;
    gap: 24px;
}

.exercise-info {
    display: flex;
    gap: 16px;
}

.exercise-info span {
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.main-btn {
    width: 200px;
    height: 200px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.main-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 60%);
    pointer-events: none;
}

.main-btn .btn-text {
    font-size: 20px;
    opacity: 0.9;
}

.main-btn .btn-time {
    font-size: 48px;
    font-weight: 700;
    margin-top: 8px;
    line-height: 1;
}

.btn-hint {
    font-size: 12px;
    color: #86868b;
    opacity: 0.7;
    flex-shrink: 0;
}

/* 状态颜色 */
.main-btn.state-idle {
    background: radial-gradient(circle at 30% 30%, #ff8c42, #ff6b35, #e85d26);
    position: relative;
    box-shadow: 
        0 8px 30px rgba(232, 93, 38, 0.4),
        inset 0 -5px 15px rgba(0, 0, 0, 0.15),
        inset 0 5px 10px rgba(255, 255, 255, 0.2);
}

.main-btn.state-idle .basketball-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

.main-btn.state-idle::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 15%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.35), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.main-btn.state-idle .btn-text,
.main-btn.state-idle .btn-time {
    display: none;
}

/* 非idle状态时隐藏篮球纹路 */
.main-btn:not(.state-idle) .basketball-lines {
    display: none;
}

.main-btn.state-ready {
    background: linear-gradient(135deg, #ffb74d, #ffa726);
}

.main-btn.state-work {
    background: linear-gradient(135deg, #66bb6a, #43a047);
}

.main-btn.state-rest {
    background: linear-gradient(135deg, #ff8a65, #ff7043);
}

.main-btn.state-pause {
    background: linear-gradient(135deg, #ef9a9a, #e57373);
}

.main-btn.state-finish {
    background: linear-gradient(135deg, #66bb6a, #43a047);
}

.main-btn.state-giveup {
    background: linear-gradient(135deg, #ef9a9a, #e57373);
}

/* 长按遮罩揭面效果 */
/* 长按时按钮变为篮球样式 */
.main-btn.long-pressing {
    background: radial-gradient(circle at 30% 30%, #ff8c42, #ff6b35, #e85d26) !important;
    box-shadow: 
        0 8px 30px rgba(232, 93, 38, 0.4),
        inset 0 -5px 15px rgba(0, 0, 0, 0.15),
        inset 0 5px 10px rgba(255, 255, 255, 0.2) !important;
}

/* 长按时显示篮球纹路 */
.main-btn.long-pressing .basketball-lines {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

/* 高光效果 */
.main-btn.long-pressing::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 15%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.35), transparent 70%);
    pointer-events: none;
    z-index: 3;
}

/* 遮罩层 - conic-gradient实现扇形扫过效果 */
.main-btn .mask-reveal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    background: conic-gradient(
        transparent 0deg,
        transparent 0deg,
        rgba(0, 0, 0, 0.55) 0deg,
        rgba(0, 0, 0, 0.55) 360deg
    );
    transition: background 0.05s linear;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 24px;
    padding: 24px;
    width: 85%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.visible .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: #f2f2f7;
    color: #86868b;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #e8e8ed;
}

.modal-body {
    max-height: 40vh;
    overflow-y: auto;
}

#stats-list {
    list-style: none;
}

#stats-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f7;
    font-size: 16px;
    color: #1d1d1f;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#stats-list li:last-child {
    border-bottom: none;
}

#stats-list li.empty {
    text-align: center;
    color: #86868b;
}

/* 结束弹窗 */
#finish-modal .modal-content {
    text-align: center;
}

.finish-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #66bb6a;
    color: #fff;
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

#finish-modal h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 30px;
}

#finish-modal p {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 24px;
}

.modal-btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 20px;
    background-color: #3b82f6;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background-color: #2563eb;
}

/* 响应式 */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .config-form {
        gap: 12px;
    }
    
    .main-btn {
        width: 160px;
        height: 160px;
    }
    
    .main-btn .btn-time {
        font-size: 36px;
    }
    
    .control-section {
        padding-top: 20px;
        padding-bottom: 30px;
        gap: 20px;
    }
}