/* --- CSS 样式设计 (暗黑极简风) --- */
:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-color: #00e676; /* 霓虹绿 */
    --accent-hover: #00c853;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

h1 span {
    color: var(--accent-color);
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 表单区域 */
.form-section {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
}

.grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

input, select {
    background-color: var(--bg-color);
    border: 1px solid #333;
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

input:focus, select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.1);
}

::placeholder {
    color: #555;
}

button.generate-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 1px;
}

button.generate-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

/* --- 核心切换 Tab --- */
.main-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
}
.main-tab-btn {
    flex: 1;
    padding: 18px 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}
.main-tab-btn.active {
    color: var(--accent-color);
}
.main-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px 2px 0 0;
}

/* --- 内容卡片 --- */
#result-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-card {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}
.content-card h2 {
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    font-size: 1.3rem;
}

/* 基础数据栏 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.05);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.stat-item strong {
    font-size: 1.2rem;
    color: var(--accent-color);
}

/* 计划内 tabs (3/5/7) */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    overflow-x: auto;
}
.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}
.tab-btn.active {
    color: var(--accent-color);
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
}


/* 训练日内容 */
.workout-day {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}
.workout-day:last-child {
    border-bottom: none;
}

.workout-day h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tag {
    display: inline-block;
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 列表样式 */
ul.list-check {
    list-style: none;
}
ul.list-check li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
ul.list-check li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}


/* --- 训练记录样式 --- */
#log-input-form {
    background-color: #282828;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.tracker-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.exercise-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px; /* 动作, 重量, 次数, 组数, 移除 */
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.set-input {
    background-color: #121212;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-primary);
    text-align: center;
}
.remove-btn {
    background: none;
    color: var(--text-secondary);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.remove-btn:hover {
    background: var(--surface-color);
    color: #ff5252;
}

/* --- 历史记录表格 --- */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.history-table th, .history-table td {
    padding: 10px;
    border-bottom: 1px solid #333;
    text-align: left;
    font-size: 0.9rem;
}
.history-table th {
    color: var(--accent-color);
    font-weight: 600;
}
.history-table tr:hover {
    background-color: #282828;
}
.history-table td:last-child {
    text-align: right;
}
.no-records {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* 响应式调整 */
@media (max-width: 700px) {
    .grid-info {
        grid-template-columns: 1fr;
    }
    .grid-inputs {
        grid-template-columns: 1fr 1fr; 
    }
}
@media (max-width: 600px) {
    .exercise-row {
        grid-template-columns: 1.5fr 1fr 1fr 1fr 40px;
    }
    .remove-btn {
        padding: 5px;
    }
}
