/* ============================================================
   班级宠物园 · 教师端 — Apple Design Language
   Aurora & Glass · Bento Grid · Physics Motion
   ============================================================ */

/* ═══════════════════════════════════════════════════════════════
   §0  Design Tokens (CSS Custom Properties)
   ═══════════════════════════════════════════════════════════════ */
:root, [data-theme="pink"] {
    /* Brand */
    --tc-primary: #FF6B9D;
    --tc-primary-light: #FF8EB3;
    --tc-primary-dark: #E8527F;
    --tc-gradient: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
    /* Apple Palette */
    --tc-bg: #F5F5F7;
    --tc-card-bg: rgba(255, 255, 255, 0.78);
    --tc-card-bg-solid: #FFFFFF;
    --tc-text: #1d1d1f;
    --tc-text-secondary: #86868b;
    --tc-border: rgba(0, 0, 0, 0.08);
    --tc-hairline: rgba(0, 0, 0, 0.06);
    /* Elevation */
    --tc-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06);
    --tc-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
    /* Radius — Apple Squircle */
    --tc-radius: 24px;
    --tc-radius-md: 18px;
    --tc-radius-sm: 12px;
    --tc-radius-xs: 8px;
    --tc-radius-pill: 980px;
    /* Glass */
    --tc-glass-blur: blur(10px);
    --tc-glass-bg: rgba(255, 255, 255, 0.78);
    --tc-glass-border: rgba(255, 255, 255, 0.6);
    /* Layout */
    --tc-nav-height: 56px;
    --tc-nav-top-inset: 16px;
    --tc-main-top: calc(var(--tc-nav-top-inset) + var(--tc-nav-height) + 24px);
    /* Motion – Spring curve */
    --tc-spring: cubic-bezier(0.25, 1, 0.5, 1);
    --tc-ease: cubic-bezier(0.4, 0, 0.2, 1);
    /* Button */
    --tc-btn-primary-bg: #0071e3;
    --tc-btn-secondary-bg: #E5E5EA;
}
[data-theme="blue"] {
    --tc-primary: #0071e3; --tc-primary-light: #4da3ff; --tc-primary-dark: #004eaf;
    --tc-gradient: linear-gradient(135deg, #0071e3 0%, #5ac8fa 100%);
}
[data-theme="green"] {
    --tc-primary: #34c759; --tc-primary-light: #5edd7e; --tc-primary-dark: #248a3d;
    --tc-gradient: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}
[data-theme="purple"] {
    --tc-primary: #af52de; --tc-primary-light: #c77deb; --tc-primary-dark: #8944ab;
    --tc-gradient: linear-gradient(135deg, #af52de 0%, #bf5af2 100%);
}
[data-theme="orange"] {
    --tc-primary: #ff9500; --tc-primary-light: #ffb340; --tc-primary-dark: #c93400;
    --tc-gradient: linear-gradient(135deg, #ff9500 0%, #ff6723 100%);
}
[data-theme="red"] {
    --tc-primary: #ff3b30; --tc-primary-light: #ff6961; --tc-primary-dark: #d70015;
    --tc-gradient: linear-gradient(135deg, #ff3b30 0%, #ff2d55 100%);
}
[data-theme="teal"] {
    --tc-primary: #5ac8fa; --tc-primary-light: #7dd8fc; --tc-primary-dark: #32ade6;
    --tc-gradient: linear-gradient(135deg, #5ac8fa 0%, #64d2ff 100%);
}
[data-theme="indigo"] {
    --tc-primary: #5856d6; --tc-primary-light: #7a78e3; --tc-primary-dark: #3634a3;
    --tc-gradient: linear-gradient(135deg, #5856d6 0%, #af52de 100%);
}
[data-theme="amber"] {
    --tc-primary: #ff9f0a; --tc-primary-light: #ffb840; --tc-primary-dark: #c87400;
    --tc-gradient: linear-gradient(135deg, #ff9f0a 0%, #ffd60a 100%);
}

/* ═══════════════════════════════════════════════════════════════
   §1  Reset & Base + Aurora Background
   ═══════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none !important; }

body.tc-body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
    font-size: 15px;
    color: var(--tc-text);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    background: var(--tc-bg);
}

/* Aurora ambient background — replaces the old .bg-paper */
.bg-paper {
    background: var(--tc-bg);
    position: relative;
}
.bg-paper::before,
.bg-paper::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
/* Orb 1 — Blue  (static — no animation, painted once) */
.bg-paper::before {
    width: 60vw;
    height: 60vw;
    top: -15vw;
    right: -10vw;
    background: radial-gradient(circle, rgba(162, 210, 255, 0.35) 0%, rgba(162, 210, 255, 0.15) 30%, rgba(162, 210, 255, 0) 65%);
}
/* Orb 2 — Purple (static — no animation, painted once) */
.bg-paper::after {
    width: 50vw;
    height: 50vw;
    bottom: -10vw;
    left: -8vw;
    background: radial-gradient(circle, rgba(200, 180, 255, 0.28) 0%, rgba(200, 180, 255, 0.12) 30%, rgba(200, 180, 255, 0) 65%);
}
@keyframes aurora-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-4vw, 3vw) scale(1.05); }
    66%      { transform: translate(3vw, -2vw) scale(0.97); }
}
@keyframes aurora-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40%      { transform: translate(5vw, -4vw) scale(1.04); }
    70%      { transform: translate(-3vw, 2vw) scale(0.96); }
}
.min-h-screen { min-height: 100vh; }

body.tc-body:not(.bg-paper) {
    background: var(--tc-bg);
}

/* ═══════════════════════════════════════════════════════════════
   §2  Navigation — Floating Glass Pill
   ═══════════════════════════════════════════════════════════════ */
.tc-nav {
    position: fixed;
    top: var(--tc-nav-top-inset);
    left: 50%;
    transform: translateX(-50%);
    width: min(1440px, calc(100% - 32px));
    height: var(--tc-nav-height);
    background: var(--tc-glass-bg);
    backdrop-filter: var(--tc-glass-blur);
    -webkit-backdrop-filter: var(--tc-glass-blur);
    border: 1px solid var(--tc-glass-border);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    animation: fade-in-down 0.6s var(--tc-spring) both;
}
@keyframes fade-in-down {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 520px) {
    .tc-nav {
        left: 12px; right: 12px;
        transform: none; width: auto;
    }
    @keyframes fade-in-down {
        from { opacity: 0; transform: translateY(-12px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}
.tc-nav-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--tc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}
.tc-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tc-nav-item-class {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
}
.tc-nav-item-class .tc-nav-item-label {
    font-size: 13px;
    color: var(--tc-text-secondary);
    white-space: nowrap;
}
.tc-nav-item-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--tc-radius-pill);
    cursor: pointer;
    transition: background 0.25s var(--tc-ease);
}
.tc-nav-item-icon:hover {
    background: rgba(0,0,0,0.04);
}
.tc-nav-item-icon .tc-btn-icon {
    width: 24px; height: 24px; font-size: 16px;
    padding: 0; background: none;
}
.tc-nav-item-icon .tc-nav-item-label {
    font-size: 13px;
    color: var(--tc-text-secondary);
    line-height: 1;
    white-space: nowrap;
}
.tc-nav-separator {
    width: 1px;
    height: 20px;
    background: var(--tc-border);
    margin: 0 4px;
}
.tc-nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}
.tc-nav-username {
    font-size: 13px;
    color: var(--tc-text-secondary);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   §3  Main Content Area
   ═══════════════════════════════════════════════════════════════ */
.tc-main {
    position: relative;
    z-index: 1;
    padding-top: var(--tc-main-top);
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
    padding-bottom: 64px;
    max-width: 1440px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   §4  Bento Card Grid
   ═══════════════════════════════════════════════════════════════ */
.tc-card-grid {
    --tc-avatar: clamp(80px, calc(5.5vw + 36px), 130px);
    --tc-card-pad-x: clamp(12px, 1.5vw, 20px);
    --tc-card-pad-y: clamp(16px, 1.8vw, 24px);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}
@media (max-width: 1400px) { .tc-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .tc-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .tc-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* ═══════════════════════════════════════════════════════════════
   §5  Student Card — Glass Bento Tile
   ═══════════════════════════════════════════════════════════════ */
.tc-card {
    background: var(--tc-card-bg-solid);
    border-radius: var(--tc-radius);
    border: 1px solid var(--tc-glass-border);
    box-shadow: var(--tc-shadow);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s var(--tc-spring), box-shadow 0.3s var(--tc-spring);
    position: relative;
}
.tc-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--tc-shadow-lg);
}
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Cascade delay for staggered card entrance */
.tc-card-grid .tc-card:nth-child(1)  { animation-delay: 0.02s; }
.tc-card-grid .tc-card:nth-child(2)  { animation-delay: 0.06s; }
.tc-card-grid .tc-card:nth-child(3)  { animation-delay: 0.10s; }
.tc-card-grid .tc-card:nth-child(4)  { animation-delay: 0.14s; }
.tc-card-grid .tc-card:nth-child(5)  { animation-delay: 0.18s; }
.tc-card-grid .tc-card:nth-child(6)  { animation-delay: 0.22s; }
.tc-card-grid .tc-card:nth-child(7)  { animation-delay: 0.26s; }
.tc-card-grid .tc-card:nth-child(8)  { animation-delay: 0.30s; }
.tc-card-grid .tc-card:nth-child(9)  { animation-delay: 0.34s; }
.tc-card-grid .tc-card:nth-child(10) { animation-delay: 0.38s; }
.tc-card-grid .tc-card:nth-child(n+11) { animation-delay: 0.40s; }

/* Card inner structure */
.tc-card-grid .tc-card {
    border: 1px solid var(--tc-glass-border);
    border-radius: var(--tc-radius);
    background: var(--tc-card-bg-solid);
    box-shadow: var(--tc-shadow);
    padding: var(--tc-card-pad-y) var(--tc-card-pad-x);
    transition: transform 0.3s var(--tc-spring), box-shadow 0.3s var(--tc-spring);
    overflow: hidden;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    min-height: 0;
}
.tc-card-grid .tc-card-texts {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.tc-card-grid .tc-card-bottom {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(6px, 0.7vw, 10px);
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}
/* Subtle gradient top accent — Apple style thin line */
.tc-card-grid .tc-card::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 3px;
    border-radius: var(--tc-radius) var(--tc-radius) 0 0;
    background: var(--tc-gradient);
    opacity: 0.7;
    transition: opacity 0.3s var(--tc-ease);
}
.tc-card-grid .tc-card:hover::before {
    opacity: 1;
}
.tc-card-grid .tc-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--tc-shadow-lg);
}
.tc-card-grid .tc-card.tc-card-selected {
    outline: 2.5px solid var(--tc-primary);
    outline-offset: 0;
}

/* ═══════════════════════════════════════════════════════════════
   §6  Pet Avatar — Gentle Breathe
   ═══════════════════════════════════════════════════════════════ */
@keyframes tc-pet-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}
.tc-card-grid .tc-card-pet {
    width: var(--tc-avatar);
    height: var(--tc-avatar);
    margin: 0 auto clamp(10px, 1.2vw, 18px);
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 22%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at 30% 25%, #fff 0%, var(--tc-bg) 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.9), 0 4px 16px rgba(0,0,0,0.06);
}
.tc-card-grid .tc-card-pet-img {
    width: 100%; height: 100%;
    max-width: var(--tc-avatar); max-height: var(--tc-avatar);
    object-fit: contain;
    border-radius: 22%;
    display: block;
}
.tc-card-grid .tc-card-pet-placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    font-size: clamp(28px, 4.2vw, 48px);
    line-height: 1;
}
/* Hover-only subtle lift on pet image */
.tc-card-grid .tc-card:hover .tc-card-pet-img {
    transform: scale(1.04);
    transition: transform 0.3s var(--tc-spring);
}
@media (prefers-reduced-motion: reduce) {
    .tc-card-grid .tc-card-pet-img,
    .tc-card-grid .tc-card-pet-placeholder { animation: none; }
    .tc-card-grid .tc-card:hover { transform: translateY(-2px); }
}

/* ═══════════════════════════════════════════════════════════════
   §7  Buttons — Apple Capsule Hierarchy
   ═══════════════════════════════════════════════════════════════ */
.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 22px;
    border-radius: var(--tc-radius-pill);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    transition: transform 0.4s var(--tc-spring), filter 0.3s var(--tc-ease), box-shadow 0.3s var(--tc-ease);
    will-change: transform;
}
.tc-btn:hover {
    transform: scale(1.02);
}
.tc-btn:active {
    transform: scale(0.97);
}
.tc-btn-primary {
    background: var(--tc-btn-primary-bg);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}
.tc-btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
}
.tc-btn-default {
    background: var(--tc-btn-secondary-bg);
    color: var(--tc-text);
    border: none;
}
.tc-btn-default:hover {
    background: #D1D1D6;
}
.tc-btn-danger {
    background: #ff3b30;
    color: #fff;
}
.tc-btn-danger:hover {
    filter: brightness(1.1);
}
.tc-btn-sm { padding: 5px 14px; font-size: 13px; }
.tc-btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: var(--tc-radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--tc-text-secondary);
    transition: background 0.3s var(--tc-spring), transform 0.3s var(--tc-spring);
}
.tc-btn-icon:hover { background: rgba(0,0,0,0.04); transform: scale(1.08); }
.tc-btn-icon:active { transform: scale(0.94); }

/* ═══════════════════════════════════════════════════════════════
   §8  Modal — Glass Dialog
   ═══════════════════════════════════════════════════════════════ */
.tc-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: mask-in 0.25s var(--tc-ease) both;
}
@keyframes mask-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tc-modal {
    background: var(--tc-card-bg-solid);
    border-radius: var(--tc-radius);
    border: 1px solid var(--tc-glass-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    animation: modal-up 0.4s var(--tc-spring) both;
}
@keyframes modal-up {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tc-modal-pet-pick { max-width: 720px; }
.tc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.tc-modal-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tc-text);
}
.tc-modal-close {
    cursor: pointer;
    font-size: 20px;
    color: var(--tc-text-secondary);
    background: rgba(0,0,0,0.04);
    border: none;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.2s var(--tc-ease), transform 0.3s var(--tc-spring);
}
.tc-modal-close:hover { background: rgba(0,0,0,0.08); transform: rotate(90deg); }
.tc-modal-footer {
    margin-top: 28px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   §9  Form Elements — Apple-style
   ═══════════════════════════════════════════════════════════════ */
.tc-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: var(--tc-radius-sm);
    background: #F2F2F7;
    font-size: 15px;
    color: var(--tc-text);
    outline: none;
    transition: background 0.3s var(--tc-ease), box-shadow 0.3s var(--tc-ease);
}
.tc-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}
.tc-input::placeholder { color: #c7c7cc; }
.tc-textarea {
    width: 100%;
    min-height: 88px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--tc-radius-sm);
    background: #F2F2F7;
    font-size: 15px;
    color: var(--tc-text);
    outline: none;
    resize: vertical;
    transition: background 0.3s var(--tc-ease), box-shadow 0.3s var(--tc-ease);
}
.tc-textarea:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}
.tc-form-group { margin-bottom: 18px; }
.tc-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--tc-text-secondary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════════
   §10  Toast — Capsule Notification
   ═══════════════════════════════════════════════════════════════ */
.tc-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 28px;
    border-radius: var(--tc-radius-pill);
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-up 0.45s var(--tc-spring) both;
}
@keyframes toast-up {
    from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.tc-toast-success { background: rgba(52, 199, 89, 0.92); }
.tc-toast-error   { background: rgba(255, 59, 48, 0.92); }

/* ═══════════════════════════════════════════════════════════════
   §11  Progress Bar — Rounded, Tinted
   ═══════════════════════════════════════════════════════════════ */
.tc-progress {
    width: 100%;
    height: 6px;
    background: #E5E5EA;
    border-radius: var(--tc-radius-pill);
    overflow: hidden;
    margin-top: 8px;
}
.tc-card-grid .tc-progress {
    height: clamp(6px, 0.8vw, 10px);
    border-radius: var(--tc-radius-pill);
    margin-top: 0;
    background: #F2F2F7;
}
.tc-card-grid .tc-progress-bar {
    border-radius: var(--tc-radius-pill);
    box-shadow: 0 0 8px rgba(0, 113, 227, 0.2);
}
.tc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tc-btn-primary-bg), #5ac8fa);
    border-radius: var(--tc-radius-pill);
    transition: width 0.5s var(--tc-spring);
}

/* ═══════════════════════════════════════════════════════════════
   §12  Auth Pages — Full-bleed Glass
   ═══════════════════════════════════════════════════════════════ */
.tc-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Re-use aurora bg from body; no gradient fallback needed */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.tc-auth-wrap::before {
    content: "";
    position: absolute;
    width: 60vw; height: 60vw;
    top: -20%; left: -10%;
    background: radial-gradient(circle, rgba(90,200,250,0.30) 0%, rgba(90,200,250,0.12) 30%, transparent 65%);
}
.tc-auth-card {
    position: relative;
    background: var(--tc-glass-bg);
    backdrop-filter: var(--tc-glass-blur);
    -webkit-backdrop-filter: var(--tc-glass-blur);
    border: 1px solid var(--tc-glass-border);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    animation: modal-up 0.5s var(--tc-spring) both;
}
.tc-auth-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
    color: var(--tc-text);
}
.tc-auth-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--tc-text-secondary);
    margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════════════════
   §13  Tags — Pill Badges
   ═══════════════════════════════════════════════════════════════ */
.tc-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--tc-radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.tc-tag-primary { background: rgba(0,113,227,0.1); color: var(--tc-btn-primary-bg); }
.tc-tag-success { background: rgba(52,199,89,0.12); color: #34c759; }
.tc-tag-warning { background: rgba(255,149,0,0.12); color: #ff9500; }
.tc-tag-danger  { background: rgba(255,59,48,0.12); color: #ff3b30; }

/* ═══════════════════════════════════════════════════════════════
   §14  Toolbar — Glass Strip
   ═══════════════════════════════════════════════════════════════ */
.tc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 16px 24px;
    background: var(--tc-glass-bg);
    border: 1px solid var(--tc-glass-border);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════
   §15  Card Text & Details
   ═══════════════════════════════════════════════════════════════ */
.tc-card-selected { outline: 2px solid var(--tc-btn-primary-bg); outline-offset: -2px; border-radius: var(--tc-radius); }
.tc-card-checkbox { position: absolute; top: 10px; left: 10px; }
.tc-card-checkbox input { width: 16px; height: 16px; accent-color: var(--tc-btn-primary-bg); }
.tc-card-pet { margin-bottom: 8px; }
.tc-card-pet-placeholder { font-size: 48px; line-height: 64px; }
.tc-card-line {
    font-size: 12px; margin-bottom: 2px; text-align: center;
    line-height: 1.4; padding: 0 4px; word-break: break-all;
    color: var(--tc-text-secondary);
}
.tc-card-line-name { font-size: 14px; font-weight: 700; color: var(--tc-text); letter-spacing: -0.02em; }
.tc-card-line-group { font-size: 11px; color: var(--tc-btn-primary-bg); margin-bottom: 4px; font-weight: 600; }
.tc-card-k { color: var(--tc-text-tertiary); font-weight: normal; font-size: 11px; }
.tc-card-line-name .tc-card-k { font-size: 12px; }
.tc-card-grid .tc-card-line {
    font-size: clamp(12px, 0.85vw + 0.35rem, 14px);
    margin-bottom: clamp(2px, 0.3vw, 4px);
    line-height: 1.4;
}
.tc-card-grid .tc-card-line-name {
    font-size: clamp(14px, 0.95vw + 0.45rem, 18px);
    font-weight: 800;
    color: var(--tc-text);
    letter-spacing: -0.03em;
}
.tc-card-grid .tc-card-line-group { font-size: clamp(11px, 0.75vw + 0.2rem, 13px); }
.tc-card-grid .tc-card-line-growth {
    font-size: clamp(10px, 0.65vw + 0.2rem, 12px);
    color: var(--tc-text-secondary);
}
.tc-card-info {
    display: flex; gap: 8px; justify-content: center;
    font-size: 12px; color: var(--tc-text-secondary); margin-top: 6px;
}
.tc-card-grid .tc-card-info {
    font-size: clamp(12px, 0.8vw + 0.3rem, 14px);
    margin-top: 0; gap: 10px;
}
.tc-card-stage { margin-top: 8px; }
.tc-card-grid .tc-card-stage { margin-top: 0; text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   §16  Rule Buttons — Tinted Pills
   ═══════════════════════════════════════════════════════════════ */
.tc-rule-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: var(--tc-radius-pill);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.35s var(--tc-spring), filter 0.25s var(--tc-ease);
}
.tc-rule-btn:hover  { transform: scale(1.06); }
.tc-rule-btn:active { transform: scale(0.96); }
.tc-rule-plus  { background: rgba(52,199,89,0.14); color: #34c759; }
.tc-rule-plus:hover  { filter: brightness(0.95); }
.tc-rule-minus { background: rgba(255,59,48,0.12); color: #ff3b30; }
.tc-rule-minus:hover { filter: brightness(0.95); }

/* ═══════════════════════════════════════════════════════════════
   §17  Pet Pick Grid — Apple Card Buttons
   ═══════════════════════════════════════════════════════════════ */
.tc-pet-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 14px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 4px;
}
.tc-pet-pick {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 14px 10px;
    min-height: 112px;
    border: none;
    border-radius: var(--tc-radius);
    background: var(--tc-card-bg-solid);
    box-shadow: var(--tc-shadow-sm);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform 0.4s var(--tc-spring), box-shadow 0.3s var(--tc-ease);
}
.tc-pet-pick:hover {
    box-shadow: var(--tc-shadow-md);
    transform: translateY(-3px) scale(1.03);
}
.tc-pet-pick:active {
    transform: translateY(0) scale(0.97);
}
.tc-pet-pick-shade {
    position: absolute;
    inset: 0;
    border-radius: var(--tc-radius);
    background: transparent;
    pointer-events: none;
    transition: background 0.25s var(--tc-ease);
}
.tc-pet-pick:hover .tc-pet-pick-shade {
    background: rgba(0, 113, 227, 0.04);
}
.tc-pet-pick-img-wrap {
    width: 64px; height: 64px; margin-bottom: 8px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tc-pet-pick-img {
    width: 100%; height: 100%;
    max-width: 80px; max-height: 80px;
    object-fit: contain;
    transition: transform 0.4s var(--tc-spring);
}
.tc-pet-pick:hover .tc-pet-pick-img {
    transform: scale(1.10);
}
.tc-pet-pick-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--tc-text);
    text-align: center;
    line-height: 1.3;
    word-break: break-all;
    letter-spacing: -0.01em;
    transition: color 0.2s var(--tc-ease);
}
.tc-pet-pick:hover .tc-pet-pick-name {
    color: var(--tc-btn-primary-bg);
}
@media (prefers-reduced-motion: reduce) {
    .tc-pet-pick:hover,
    .tc-pet-pick:active,
    .tc-pet-pick:hover .tc-pet-pick-img {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   §18  Tabs — Underline Capsule
   ═══════════════════════════════════════════════════════════════ */
.tc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
    border-bottom: 1px solid var(--tc-border);
    padding-bottom: 0;
}
.tc-tab {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--tc-text-secondary);
    transition: color 0.25s var(--tc-ease), border-color 0.25s var(--tc-ease);
}
.tc-tab:hover { color: var(--tc-text); }
.tc-tab.active {
    color: var(--tc-btn-primary-bg);
    border-bottom-color: var(--tc-btn-primary-bg);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   §19  Logs — Grouped Rows
   ═══════════════════════════════════════════════════════════════ */
.tc-log-list { max-height: 400px; overflow-y: auto; }
.tc-log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tc-border);
    font-size: 13px;
    flex-wrap: wrap;
}
.tc-log-name { font-weight: 700; min-width: 60px; letter-spacing: -0.01em; }
.tc-log-type { padding: 2px 10px; border-radius: var(--tc-radius-pill); font-size: 11px; font-weight: 600; }
.tc-log-feed     { background: rgba(52,199,89,0.12); color: #34c759; }
.tc-log-graduate { background: rgba(255,149,0,0.12); color: #ff9500; }
.tc-log-undo     { background: #F2F2F7; color: #8e8e93; }
.tc-log-reset    { background: rgba(255,59,48,0.12); color: #ff3b30; }

/* ═══════════════════════════════════════════════════════════════
   §20  Mini Select
   ═══════════════════════════════════════════════════════════════ */
.tc-select-mini {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--tc-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238e8e93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: var(--tc-text);
    cursor: pointer;
    transition: border-color 0.25s var(--tc-ease), box-shadow 0.25s var(--tc-ease);
}
.tc-select-mini:focus { border-color: var(--tc-btn-primary-bg); box-shadow: 0 0 0 3px rgba(0,113,227,0.12); }
.tc-select-mini:hover { border-color: #c7c7cc; }

/* Toolbar compact input */
.tc-toolbar .tc-input {
    width: 128px;
    height: 32px;
    font-size: 13px;
    padding: 0 10px;
    border: 1px solid var(--tc-border);
    background: #fff;
}
.tc-toolbar .tc-input:focus {
    border-color: var(--tc-btn-primary-bg);
}

/* ═══════════════════════════════════════════════════════════════
   §21  Misc Utilities
   ═══════════════════════════════════════════════════════════════ */
.tc-empty { text-align: center; padding: 60px 20px; color: var(--tc-text-secondary); }
.tc-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.tc-divider { border: none; border-top: 1px solid var(--tc-border); margin: 24px 0; }
.tc-flex { display: flex; }
.tc-flex-center { align-items: center; }
.tc-flex-between { justify-content: space-between; }
.tc-gap-8 { gap: 8px; }
.tc-gap-12 { gap: 12px; }
.tc-mt-16 { margin-top: 16px; }
.tc-mb-16 { margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════════
   §EVO  Evolution Effect Overlay
   ═══════════════════════════════════════════════════════════════ */
.tc-evo-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    cursor: pointer;
    animation: tcEvoFadeIn 0.3s ease-out;
}
@keyframes tcEvoFadeIn { from { opacity: 0; } to { opacity: 1; } }

.tc-evo-halo {
    position: absolute; width: 260px; height: 260px; border-radius: 50%;
    animation: tcEvoHalo 1.2s ease-out both;
}
.tc-evo-halo-1 { background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%); box-shadow: 0 0 60px rgba(255,215,0,0.4); }
.tc-evo-halo-2 { background: radial-gradient(circle, rgba(123,104,238,0.35) 0%, transparent 70%); box-shadow: 0 0 80px rgba(147,112,219,0.5); }
.tc-evo-halo-3 { background: radial-gradient(circle, rgba(255,69,0,0.35) 0%, transparent 70%); box-shadow: 0 0 100px rgba(255,99,71,0.5); }
@keyframes tcEvoHalo {
    0% { transform: scale(0.2); opacity: 0; }
    40% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.tc-evo-pet {
    width: 160px; height: 160px; border-radius: 22%;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2;
}
.tc-evo-pet-1 { background: linear-gradient(135deg, #FFF8DC, #FFFACD); box-shadow: 0 0 30px rgba(255,215,0,0.5); animation: tcEvoBounce1 0.8s cubic-bezier(0.34,1.56,0.64,1) both; }
.tc-evo-pet-2 { background: linear-gradient(135deg, #E8E0FF, #F0EBFF); box-shadow: 0 0 40px rgba(123,104,238,0.5); animation: tcEvoBounce2 0.8s cubic-bezier(0.34,1.56,0.64,1) both; }
.tc-evo-pet-3 { background: linear-gradient(135deg, #FFE4D6, #FFF0E6); box-shadow: 0 0 50px rgba(255,69,0,0.5); animation: tcEvoBounce3 0.8s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes tcEvoBounce1 { 0% { transform: scale(0.3) rotate(-10deg); opacity: 0; } 50% { transform: scale(1.15) rotate(5deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes tcEvoBounce2 { 0% { transform: scale(0.2) rotate(180deg); opacity: 0; } 50% { transform: scale(1.2) rotate(-5deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes tcEvoBounce3 { 0% { transform: scale(0.1); opacity: 0; filter: brightness(3); } 40% { transform: scale(1.3); opacity: 1; filter: brightness(1.5); } 70% { transform: scale(0.95); filter: brightness(1); } 100% { transform: scale(1); } }

.tc-evo-text { margin-top: 28px; text-align: center; z-index: 2; }
.tc-evo-flash { font-size: 14px; font-weight: 600; letter-spacing: 4px; animation: tcEvoTextIn 0.6s ease-out 0.4s both; }
.tc-evo-name { font-size: 30px; font-weight: 800; letter-spacing: 6px; margin-top: 8px; animation: tcEvoNameIn 0.7s ease-out 0.6s both; }
.tc-evo-c-1 { color: #FFD700; text-shadow: 0 2px 16px rgba(255,215,0,0.7); }
.tc-evo-c-2 { color: #B19CD9; text-shadow: 0 2px 16px rgba(147,112,219,0.7); }
.tc-evo-c-3 { color: #FF6347; text-shadow: 0 2px 16px rgba(255,99,71,0.7); }
@keyframes tcEvoTextIn { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes tcEvoNameIn { 0% { opacity: 0; transform: translateY(20px) scale(0.8); } 60% { transform: translateY(-3px) scale(1.05); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

.tc-evo-dismiss {
    position: absolute; bottom: 60px;
    color: rgba(255,255,255,0.35); font-size: 13px;
    animation: tcEvoDismiss 2s ease-in-out 2s infinite;
}
@keyframes tcEvoDismiss { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.7; } }
