/* 计数器工具专用样式 */

/* ==================== 模式切换 ==================== */
.counter-section {
    display: none;
    margin: 20px 0;
}

.counter-section.active {
    display: block;
}

.mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-tab {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.mode-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* ==================== 设置区域 ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group,
.counter-settings,
.target-settings,
.multi-settings,
.tally-settings,
.history-section,
.settings-section {
    background: rgba(255,255,255,0.9);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.form-group:hover,
.counter-settings:hover,
.target-settings:hover,
.multi-settings:hover,
.tally-settings:hover,
.history-section:hover,
.settings-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.form-label,
.section-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.form-input {
    border-radius: 12px !important;
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    padding: 12px 16px !important;
    transition: all 0.3s ease !important;
}

.form-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px) !important;
}

/* ==================== 普通计数器 ==================== */
.main-counter {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.counter-display {
    margin-bottom: 30px;
}

.counter-name-display {
    font-size: 18px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.counter-value {
    font-size: 72px;
    font-weight: bold;
    line-height: 1;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.counter-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
    opacity: 0.8;
}

.counter-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.counter-btn {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.counter-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.counter-btn.increase {
    background: rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.5);
}

.counter-btn.decrease {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}

.quick-operations {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.quick-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ==================== 目标计数器 ==================== */
.target-input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.input-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.target-counter {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.target-info h3 {
    margin: 0 0 10px 0;
    color: #007bff;
}

.target-info p {
    margin: 0 0 20px 0;
    color: #6c757d;
}

.progress-display {
    margin: 30px 0;
}

.progress-circle {
    position: relative;
    display: inline-block;
}

.progress-svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 8;
}

.progress-bar {
    fill: none;
    stroke: #007bff;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.current-value {
    font-size: 36px;
    font-weight: bold;
    color: #007bff;
    line-height: 1;
}

.progress-percentage {
    font-size: 14px;
    color: #6c757d;
}

.target-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.target-status {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.status-item {
    text-align: center;
}

.status-label {
    display: block;
    font-size: 14px;
    color: #6c757d;
}

.status-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

/* ==================== 多计数器 ==================== */
.multi-settings {
    margin: 20px 0;
}

.multi-controls {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.multi-counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.multi-counter-card {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.counter-name-input {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
}

.remove-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.counter-value-display {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    color: #007bff;
    margin: 20px 0;
}

.counter-step-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}

.step-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* ==================== 正字计数器 ==================== */
.tally-settings {
    margin: 20px 0;
}

.tally-description {
    color: #6c757d;
    font-style: italic;
}

.tally-counter {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.tally-title {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 20px;
}

.tally-marks {
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.tally-group {
    display: inline-block;
}

.tally-char {
    font-size: 48px;
    font-weight: bold;
    color: #007bff;
    font-family: 'SimSun', serif;
}

.empty-tally {
    color: #6c757d;
    font-style: italic;
}

.tally-total {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
    margin: 20px 0;
}

.tally-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

/* ==================== 历史记录 ==================== */
.history-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.history-controls {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.history-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.history-mode {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.history-action {
    font-weight: bold;
}

.history-value {
    color: #28a745;
}

.history-time {
    font-size: 12px;
    color: #6c757d;
}

/* ==================== 设置选项 ==================== */
.settings-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.settings-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 按钮样式 ==================== */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4) !important;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.btn-outline {
    background: rgba(255,255,255,0.9) !important;
    color: #667eea !important;
    border: 2px solid #667eea !important;
}

.btn-outline:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* ==================== 通用样式 ==================== */
.empty-state {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .mode-tabs {
        justify-content: center;
    }

    .mode-tab {
        flex: 1;
        min-width: 80px;
        font-size: 12px;
        padding: 8px 12px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .counter-value {
        font-size: 48px;
    }

    .counter-controls {
        flex-direction: column;
        align-items: center;
    }

    .counter-btn {
        width: 60px;
        height: 60px;
        font-size: 16px;
    }

    .quick-operations {
        justify-content: center;
    }

    .target-status {
        flex-direction: column;
        gap: 15px;
    }

    .multi-counters {
        grid-template-columns: 1fr;
    }

    .history-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .history-controls,
    .multi-controls,
    .target-controls,
    .tally-controls {
        justify-content: center;
    }
}
