/* 运动记录页面样式 */

:root {
    --primary-color: #f97316; /* 运动主题色：活力橙 */
    --primary-light: #ffedd5;
    --primary-dark: #ea580c;
    --bg-gradient: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    --card-shadow: 0 10px 25px rgba(249, 115, 22, 0.1);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #fff7ed;
}

.container-fluid {
    padding: 20px;
    min-height: 100vh;
    background: var(--bg-gradient);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin: 0;
}

.btn-back {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-back:hover {
    transform: translateX(-5px);
}

.exercise-main {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.exercise-card h2, .exercise-card h3 {
    margin-top: 0;
    color: #431407;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

/* 进度环样式 */
.progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.progress-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 20px 0;
}

svg {
    transform: rotate(-90deg);
}

circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

circle.bg {
    stroke: #fed7aa;
}

circle.bar {
    stroke: var(--primary-color);
    stroke-dasharray: 283; /* 2 * PI * 45 */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#currentDuration {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-dark);
    display: block;
}

.progress-text small {
    color: #9a3412;
    font-size: 0.9rem;
}

.status-tip {
    font-weight: 500;
    color: #ea580c;
    background: #fff7ed;
    padding: 8px 15px;
    border-radius: 20px;
}

/* 快速添加按钮 */
.quick-btns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.add-btn {
    background: #fff7ed;
    border: 1px solid #ffedd5;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s;
    color: #7c2d12;
    display: flex;
    align-items: center;
}

.add-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.2);
}

.btn-custom {
    grid-column: span 2;
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 10px;
}

.btn-custom:hover {
    background: #c2410c;
}

.btn-manage-quick {
    grid-column: span 2;
    background: #fff;
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 5px;
    transition: all 0.2s;
}

.btn-manage-quick:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* 快速设置列表 */
.quick-settings-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.quick-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ffedd5;
    gap: 10px;
}

.quick-setting-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-setting-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
}

.quick-add-form {
    background: #fff7ed;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #fed7aa;
}

.quick-add-form h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #7c2d12;
}

.quick-form-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.quick-form-row input {
    padding: 8px;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-add-quick {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

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

/* 日志列表样式 */
.logs-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.log-date-header {
    font-size: 0.95rem;
    font-weight: bold;
    color: #7c2d12;
    background: #ffedd5;
    padding: 8px 15px;
    border-radius: 8px;
    margin: 20px 0 12px 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.log-date-header:first-child {
    margin-top: 0;
}

.log-item {
    display: grid;
    grid-template-columns: 80px 120px 1fr 80px;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ffedd5;
    transition: background 0.2s;
}

.log-item:hover {
    background: #fffaf5;
}

.log-time {
    color: #9a3412;
    font-size: 0.85rem;
}

.log-type {
    font-weight: bold;
    color: #431407;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-duration {
    color: var(--primary-dark);
    font-weight: 600;
    text-align: right;
    padding-right: 20px;
}

.log-note {
    grid-column: 2 / 5;
    font-size: 0.9rem;
    color: #9a3412;
    margin-top: 5px;
    font-style: italic;
}

.log-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-edit-small {
    color: #3b82f6;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.85rem;
}

.btn-delete {
    color: #ef4444;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.85rem;
}

.empty-tip {
    text-align: center;
    color: #9a3412;
    padding: 50px 0;
    opacity: 0.6;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.stat-item {
    background: #fff7ed;
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #ffedd5;
}

.stat-label {
    font-size: 0.8rem;
    color: #9a3412;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-dark);
}

.chart-container {
    background: #fffcf9;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #ffedd5;
}

.chart-header {
    font-size: 0.9rem;
    font-weight: bold;
    color: #7c2d12;
    margin-bottom: 20px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 10px;
}

.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.chart-bar {
    width: 100%;
    background: #fed7aa;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all 0.4s ease;
    min-height: 4px;
}

.chart-bar.reached {
    background: var(--primary-color);
}

.chart-bar:hover {
    background: var(--primary-dark);
    transform: scaleX(1.1);
}

.chart-bar::before {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--primary-dark);
    white-space: nowrap;
}

.chart-label {
    font-size: 0.75rem;
    color: #9a3412;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #431407;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #431407;
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    display: none;
    z-index: 2000;
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
